<?php
class HomeFloorValidate extends Validate {
	protected function valid() {
		$result = array ();
		
		if (isset ( $this->param ['dataFloorDetailOrder'] ) 
		&& $this->param ['dataFloorDetailOrder'] != null ) {
			if (! preg_match ( "/^\d+$/", $this->param ['dataFloorDetailOrder'])
			|| $this->param ['dataFloorDetailOrder'] > 99999 ) {
				$result ['result'] = 'error';
				$result ['error'] = '排序号只能为小于99999正整数';
				return $result;
			}
		}
		
		if (empty ( $this->param ['dataFloorDetailOrder'] )) {
			$this->param ['dataFloorDetailOrder'] = 1; // 排序号设为0
		}
		
		if (empty ( $this->param ['viewDataFloorId'] ) 
		|| $this->param ['viewDataFloorId'] == - 1) {
			$result ['result'] = 'error';
			$result ['error'] = '请选择数据分类';
			return $result;
		}
		
		$result ['result'] = 'success';
		return $result;
	}
}
?>